package com.db.login;

import java.io.Reader;
import java.util.*;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class JoinManager {

	private static SqlMapClient sqlmap;
	static{
		try{
			Reader reader=Resources.getResourceAsReader("com/db/config/SqlMapConfig.xml");
			sqlmap=SqlMapClientBuilder.buildSqlMapClient(reader);
		}catch(Exception ex){
			System.out.println(ex.getMessage());
		}
	}
	
	public static int IdCheck(String id)throws Exception{
		return (Integer)sqlmap.queryForObject("checkid",id);
	}
	
	public static int JuminCheck(String jumin)throws Exception{
		return (Integer)sqlmap.queryForObject("checkJumin",jumin);
	}
	
	public static void isLogin(Map map)throws Exception{
		sqlmap.queryForObject("isLogin",map);
	}
	
	public static void OkJoin(Map vo)throws Exception{
		sqlmap.queryForObject("OkJoin",vo);
	}
	
	public static void delete(Map vo)throws Exception{
		sqlmap.queryForObject("delete",vo);
	}
	
}
